import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinTable, PrimaryColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { UserStatus, Gender } from '@type/common';
import { DefaultEntity } from '@type/common'

@Entity()
export class UserEntity extends DefaultEntity{
    @PrimaryColumn({
        comment: '用户uuid',
        type: 'uuid'
    })
    id: string;

    @Column({
        comment: '用户名',
        length: 32,
        nullable: true
    })
    username: string;

    @Column({
        comment: '密码',
        length: 32,
        nullable: true
    })
    password: string;

    @Column({
        comment: '头像',
        length: 100,
        nullable: false
    })
    avator: string;

    @Column({
        comment: '别称',
        length: 32,
        nullable: true,
    })
    nickname: string;

    // @Column({
    //     type: 'tinyint',
    //     default: UserStatus.NORMAL
    // })
    // status: UserStatus;

    @Column({
        comment: '手机号',
        length: 32,
        nullable: true,
    })
    phone: string;

    @Column({
        type: 'tinyint',
        default: 0,
        comment: '性别：0未知，1男，2女'
    })
    gender: 0|1|2;
}






